<script type='text/javascript'>
/*
	function MenuViewModel(){
		self.menu_items = [
			{ text: 'Hello'},
			{ text: 'World'}
		];
	}

	ko.applyBindings(new MenuViewModel());
*/

function RetrieveData(){
	var deferreds = [];
	console.log('Retrieving Data');
	
	deferreds.push(
		$.getJSON('/request_data', {model_name: 'income'}, function(data){
			window.income = data;
		})
	);
	deferreds.push(
		$.getJSON('/request_data', {model_name: 'expense'}, function(data){
			window.expense = data;
		})
	);
	deferreds.push(
		$.getJSON('/request_data', {model_name: 'saving'}, function(data){
			window.saving = data;
		})
	);
	deferreds.push(
		$.getJSON('/request_data', {model_name: 'purchase'}, function(data){
			window.purchase = data;
		})
	);
	
	var promise = $.when(deferreds);
	promise.done(DoneLoading);
	promise.fail(function(){
		console.log('A promise failed!');
	});
}

</script>
<p>Welcome to Nate's budgeting service</p>